<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      let arr = ['豆腐皮', '豆腐脑', '豆腐块', '豆腐干']
      let num = Math.floor(Math.random() * arr.length)
      //把随机抽到的人打印出来
      console.log(arr[num])
      //splice  把抽到的删除掉
      arr.splice(num, 1)
      console.log(arr)
    </script>
  </body>
</html>
